package com.itheima.test;

import java.util.ArrayList;
import java.util.Iterator;

public class ArrListDemo {
    public static void main(String[] args) {
        ArrayList<String> arrayList=new ArrayList<>();
        arrayList.add("a");
        arrayList.add("b");
        arrayList.add("c");


        Iterator<String> it=arrayList.iterator();
        while (it.hasNext()){
            String next = it.next();
            if (next.equals("b"))
            it.remove();
//          arrayList.remove("c");
     }
        System.out.println(arrayList);
    }
}
